package com.xh.rufongwallpaper.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 设备偏好设置实体类
 *
 * @author XH
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("preference")
public class Preference implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 设置ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 设备ID
     */
    @TableField("device_id")
    private Long deviceId;

    /**
     * 暗黑模式
     */
    @TableField("dark_mode")
    private Boolean darkMode = false;

    /**
     * 自动保存
     */
    @TableField("auto_save")
    private Boolean autoSave = true;

    /**
     * 壁纸质量(high/medium/low)
     */
    @TableField("wallpaper_quality")
    private String wallpaperQuality = "high";

    /**
     * 通知开关
     */
    @TableField("notification")
    private Boolean notification = true;

    /**
     * 创建时间
     */
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    /**
     * 是否删除
     */
    @TableField("is_deleted")
    @TableLogic
    private Boolean isDeleted = false;

    /**
     * 设备对象（非数据库字段）
     */
    @TableField(exist = false)
    private Device device;
} 